<?php
include_once 'config.php';
$ret = exec($program . "preprocess ".$_POST["model_name"]." ".$_POST["preprocess"]." ".$_POST["attr"]);
$result=array();
if ($ret != "fail") {
    $result["status"] = "ok";
    chmod ("data/".$_POST["model_name"].".arff",  0777);
    $result["link"] = "http://".$_SERVER["HTTP_HOST"]."/wekaws/data/{$_POST['model_name']}.arff";
    echo json_encode($result);
} else {
    $result["status"] = "fail";
    echo json_encode($result);
}
?>
